package com.example.demo.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * @author wsj
 */
@Setter
public class ResultException extends RuntimeException {
    // Getter 和 Setter 方法
    @Getter
    private int code;
    private String message;

    // 构造函数
    public ResultException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public ResultException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }

}
